﻿/**
 * \file CSingletonFactory.h
 * \reversion 0.1
 * \brief 单件工厂模板
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __CSINGLETON__FACTORY__H
#define __CSINGLETON__FACTORY__H

/// 单件工厂模板类，继承使用
template <typename _T>
class CSingletonFactory
{
public:
	CSingletonFactory() {};
	~CSingletonFactory() {};

public:
	/// 得到唯一实例
	static _T& GetInstance()
	{
		static _T g_Instance;
		return g_Instance;
	}
};

#endif	/// __CSINGLETON__FACTORY__H